

<template>

    <div style="width:90%;margin:0 auto;height:500px;overflow-y:scroll" >
        <el-page-header  @back="goBack" content="公告详情"></el-page-header >
        <h1>{{releaseData.title}}</h1>
        <div hidden><mavon-editor  v-model="releaseData.content" @change="handle" ></mavon-editor></div>

        <article v-html="myhtml"></article>

    </div>
</template>

<script>
    // eslint-disable-next-line no-unused-vars
    import { request } from "@/axios/request"
    export default {
        name: "viewRelease",
        components: {},
        data() {
            return { releaseData:null,
                myhtml:""};
        },
        created() {
        this.getData();
        },

        methods: {
            handle(value, render) {
                this.myhtml = render;
                console.log(value, render);
            },
            getData(){
                request({
                    url: "/notice/5",
                    method: "get",
                }).then((res) => {
                    this.$nextTick(() => { // 注意看这里
                        this.releaseData = res.data.object;
                    })

                });
            },
            goBack() {
                this.$router.push({ path: "/home/release" });
            }
        }
    };
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
</style>


